const express=require('express')
const app=express()
app.listen(3001)
const {createProxyMiddleware}=require('http-proxy-middleware')

const proxy = createProxyMiddleware({
    target:'http://localhost:3000',
    changeOrigin:true

})



//静态托管public文件夹 读取里面的文件
app.use(express.static('public'))

app.use((req,res)=>{
    proxy(req,res)
})